package cn.changgou.goods.handler;

import cn.changgou.common.pojo.Result;
import cn.changgou.common.pojo.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BaseExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public Result error(Exception e){
        return new Result(false, StatusCode.ERROR,"服务器维护中，请销后再试",e.getMessage());
    }
}
